<template>
    <my-ref
        url="/dev/git-server/list"
        v-model="table"
        @loaded="procData"
        :multi="$props.multi"
        :page-size="10"
        ref="list"
        name="Git服务器"
        :store="true"
        v-bind="$attrs"
        :readOnly="$props.readOnly"
    >


        <el-table-column label="name" align="center">
            <template v-slot="scope">
                <div class="link">{{ scope.row.name }}</div>
            </template>
        </el-table-column>
        <el-table-column align="center" label="地址" prop="host"></el-table-column>
        <template #query="scope">
        <kv label="名称">
            <el-input v-model="scope.query.name"></el-input>
        </kv>
        </template>
        <template #button>
            <el-button>选择Git服务器</el-button>
        </template>
    </my-ref>
</template>
<script setup>
/**
 * Created by CodeGenerator at 2021-04-12 12:10:50
 */



defineOptions({
    name: "git-server-ref",
    inheritAttrs: true,
});

//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({});


const $props = defineProps({
    readOnly : { type: Boolean },
    multi : { type: Boolean }
});


const $model = defineModel({ type: [Object,Array] });



const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);

const table = $computed({ get() {
        return $model;
    },set(v){
        var v = Object.assign(v.getJsType() == "array" ? [] : {}, v);
        $emit("update:modelValue", v);
    } });

const procData = function(res, op) {
    var json = res.data.data;
    json.forEach(it => {
//如果是组合实体，设置 it.id=...
    });
};

</script>